home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Dictionary.h
-
- Copyright: © 1984-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
-
- #ifndef __DICTIONARY__
- #define __DICTIONARY__
-
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- /* #include <ConditionalMacros.h> */
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
- /* #include <MixedMode.h> */
- /* #include <OSUtils.h> */
- /* #include <Memory.h> */
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if GENERATINGPOWERPC
- #pragma options align=mac68k
- #endif
-
- #ifdef __CFM68K__
- #pragma lib_export on
- #endif
-
-
- enum {
- /* Dictionary data insertion modes */
- kInsert = 0, /* Only insert the input entry if there is nothing in the dictionary that matches the key. */
- kReplace = 1, /* Only replace the entries which match the key with the input entry. */
- kInsertOrReplace = 2 /* Insert the entry if there is nothing in the dictionary which matches the key.
- If there is already matched entries, replace the existing matched entries with the input entry. */
- };
-
- /* This Was InsertMode */
- typedef short DictionaryDataInsertMode;
-
-
- enum {
- /* Key attribute constants */
- kIsCaseSensitive = 0x10, /* case sensitive = 16 */
- kIsNotDiacriticalSensitive = 0x20 /* diac not sensitive = 32 */
- };
-
- enum {
- /* Registered attribute type constants. */
- kNoun = -1,
- kVerb = -2,
- kAdjective = -3,
- kAdverb = -4
- };
-
- /* This Was AttributeType */
- typedef SInt8 DictionaryEntryAttribute;
-
- /* Dictionary information record */
- struct DictionaryInformation {
- FSSpec dictionaryFSSpec;
- long numberOfRecords;
- long currentGarbageSize;
- ScriptCode script;
- short maximumKeyLength;
- SInt8 keyAttributes;
- SInt8 filler;
- };
- typedef struct DictionaryInformation DictionaryInformation;
-
- struct DictionaryAttributeTable {
- UInt8 datSize;
- DictionaryEntryAttribute datTable[1];
- };
- typedef struct DictionaryAttributeTable DictionaryAttributeTable;
-
- typedef DictionaryAttributeTable *DictionaryAttributeTablePtr;
-
- extern pascal OSErr InitializeDictionary(const FSSpec *theFsspecPtr, short maximumKeyLength, unsigned char keyAttributes, ScriptCode script)
- THREEWORDINLINE(0x303C, 0x0500, 0xAA53);
- extern pascal OSErr OpenDictionary(const FSSpec *theFsspecPtr, char accessPermission, long *dictionaryReference)
- THREEWORDINLINE(0x303C, 0x0501, 0xAA53);
- extern pascal OSErr CloseDictionary(long dictionaryReference)
- THREEWORDINLINE(0x303C, 0x0202, 0xAA53);
- extern pascal OSErr InsertRecordToDictionary(long dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
- THREEWORDINLINE(0x303C, 0x0703, 0xAA53);
- extern pascal OSErr DeleteRecordFromDictionary(long dictionaryReference, ConstStr255Param key)
- THREEWORDINLINE(0x303C, 0x0404, 0xAA53);
- extern pascal OSErr FindRecordInDictionary(long dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
- THREEWORDINLINE(0x303C, 0x0805, 0xAA53);
- extern pascal OSErr FindRecordByIndexInDictionary(long dictionaryReference, long recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
- THREEWORDINLINE(0x303C, 0x0A06, 0xAA53);
- extern pascal OSErr GetDictionaryInformation(long dictionaryReference, DictionaryInformation *theDictionaryInformation)
- THREEWORDINLINE(0x303C, 0x0407, 0xAA53);
- extern pascal OSErr CompactDictionary(long dictionaryReference)
- THREEWORDINLINE(0x303C, 0x0208, 0xAA53);
-
- #ifdef __CFM68K__
- #pragma lib_export off
- #endif
-
- #if GENERATINGPOWERPC
- #pragma options align=reset
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __DICTIONARY__ */
-